package com.kfm.hotel.controller;

import com.kfm.hotel.mapper.IntakeInfoMapper;
import com.kfm.hotel.service.IntakeInfoService;
import com.kfm.hotel.service.RoomService;
import com.kfm.hotel.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/welcome")
public class WelcomeController {
    @Autowired
    private IntakeInfoService intakeInfoService;

    @Autowired
    private RoomService roomService;

    @GetMapping("/room")
    public R room(){
        return R.ok(roomService.getRoomCount());
    }

    @GetMapping("/income")
    public R income(){
        return R.ok(intakeInfoService.getIncome());
    }


    @GetMapping("/incomeByDate")
    public R incomeByDate(){
        return R.ok(intakeInfoService.getIncomeByDate());
    }
}
